import request from '@/utils/request'
export default {
  // 1添加课程信息
  addCourseInfo(courseInfo) {
    return request({
      url: '/eduservice/course/addCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  // 2:查询所有讲师
  getListTeacher() {
    return request({
      url: '/eduservice/teacher/findAll',
      method: 'get'
    })
  },
  // 根据课程ID查询课程基本信息
  getCourseInfoId(id){
    return request({
      url:`/eduservice/course/getCourseInfo/${id}`,
      method:'get'
    })
  },

  // 修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/updateCourseInfo/`,
      method: 'post',
      data: courseInfo
    })
  },

  //课程确认信息
  getPublicCourseInfo(courseId) {
    return request({
      url: `/eduservice/course/getPublishCourseInfo/${courseId}`,
      method: 'get',
    })
  },

  //课程最终发布
  publicCourse(courseId) {
    return request({
      url: `/eduservice/course/publishCourse/${courseId}`,
      method: 'post',
    })
  },

  //查询所有课程
  getListCourse(current, limit, courseQuery) {
    return request({
      url: '/eduservice/course/getCourseList/' + current + '/' + limit,
      method: 'post',
      data: courseQuery
    })
  },

  //删除课程信息
  deleteCourse(courseId) {
    return request({
      url: `/eduservice/course/${courseId}`,
      method: 'delete'
    })
  }
}
